
<section>
	<div class="page_title">
		<h2 class="fl">修改用户组</h2>
        <a class="fr top_rt_btn iconfont iconfont-chexiao" href="{:U('admin/User/groupList')}">用户组列表</a>
	</div>
	<ul class="ulColumn2">
		{volist name='group' id='v'}
		<input type="hidden" name="id" value="{:encrypt_id($v.id)}" />
		<li>
			<span class="item_name" style="width:120px;">用户组名：</span>
			<input type="text" name="title" class="textbox textbox_295" value="{$v['title']}">
		</li>

		<li>
			<span class="item_name" style="width:120px;">是否开启用户组：</span>
			<input type="checkbox" id="checkbox_d1" name="status" class="chk_4" {eq name='v.status' value='1'}checked{/eq} ><label for="checkbox_d1"></label>
		</li>
		<!--<li>-->
			<!--<span class="item_name" style="width:120px;">拥有权限（编号）：</span>-->
			<!--<input type="text" class="textbox textbox_295" name="rules" value="{$v.rules}">-->
		<!--</li>-->
		{/volist}
		<li>
			<span class="item_name" style="width:120px;"></span>
			<input type="submit" class="link_btn updategroup" style="margin-left: 300px">
		</li>
	</ul>
</section>
<script>
	$('.updategroup').click(function () {
		//检测账号
		var id = $("input[name=id]").val();
		var title = $("input[name=title]").val();
		if(!title)
		{
			msg_warning('用户组名不能为空');
			return false;
		}
		//checkbox属性
		if($("input[type='checkbox']").is(':checked'))
		{
			var status = 1;
		}else
		{
			var status = 0;
		}
		//选择用户组
//		var rules = $("input[name=rules]").val();
		var data = {id:id,title:title,status:status};
		send_data = {
			url:U('admin/User/updateGroup'),
			type:'POST',
			data:data,
			dataType:'json',
		}
		send_ajax(send_data,function(res){
			if(res.status == 1){
				msg_success('修改成功','',2000);
				setTimeout(function(){
					admin.getContentByUrl(res.data.jumpurl);
				},2000);
			}else{
				msg_error(res.message);
			}
		})
	});

	$(function(){
		//调用登陆部分的js
		$(window).keyup(function(e){
			if(e.keyCode == 13){
				$(".updategroup").click();
			}
		})
	});
</script>